package net.lab1024.sa.admin.module.business.category.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.admin.common.JsonTypeHandler;

import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Data
@TableName("synthesis_record")
public class SynthesisRecord {
    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "化学名称")
    @NotBlank(message = "化学名称不能为空")
    private String chemicalName; // 原任务标题

    @Schema(description = "模型名称")
    private String modelName; // 模型名称

    @Schema(description = "数据库名称")
    private String databaseName; // 数据库名称

    @Schema(description = "目标分子SMILES")
    @NotBlank(message = "目标分子SMILES不能为空")
    private String targetSmiles;

    @Schema(description = "逆合成详情(拓扑图)")
    @TableField(exist = false)
    private RetroResult2 retroResult2;

    @Schema(description = "逆合成详情(拓扑图)")
    private String resultJson;

    //    @TableField(typeHandler = JsonTypeHandler.class)
    //    private Map<String, RetroResult.SynthesisPath> resultJson;

    @TableField(exist = false)
    private Map<String, RetroResult.SynthesisPath> resultJson2;

    @Schema(description = "姓名")
    //    @NotBlank(message = "创建者姓名不能为空")
    private String creatorName;

    @Schema(description = "学号")
    //    @NotBlank(message = "学号/工号不能为空")
    private String creatorId;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @Schema(description = "创建时间(显示)")
    @TableField(exist = false)
    private String strCreateTime;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "更新时间(显示)")
    @TableField(exist = false)
    private String strUpdateTime;

    @Schema(description = "描述记录")
    private String remark;

    //    @NotBlank(message = "合成过程描述不能为空")
    private String processDescription; // XX物质的N步合成过程

    // 明细列表（非数据库字段）
    //@TableField(exist = false)
    //private List<RecordDetail> details;
}
